package com.inspinia.upms.common.model.user;

import com.inspinia.base.common.model.NameCodeEnum;

/**
 * 用户状态
 * 
 */
public enum UpmsUserStatus implements NameCodeEnum {

    OK(0, "正常"), DISABLE(1, "停用"), DELETED(2, "删除");

    private final int code;
    private final String name;

    UpmsUserStatus(int code, String name){
        this.code=code;
        this.name=name;
    }

    @Override
    public int getCode(){
        return code;
    }

    @Override
    public String getName(){
        return name;
    }


    public static UpmsUserStatus valueOf(int code){
        for(UpmsUserStatus status:UpmsUserStatus.values()){
            if(status.code==code){
                return status;
            }
        }
        return null;
    }
}
